package cn.lzj.ymcc.feign;

import cn.lzj.ymcc.domain.Login;
import cn.lzj.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UaaLoginFeignClientFallbackFactory implements FallbackFactory<UaaLoginFeignClient> {
    @Override
    public UaaLoginFeignClient create(Throwable throwable) {
        return new UaaLoginFeignClient() {

            @Override
            public JSONResult savalogin(Login login) {
                throwable.printStackTrace();
                return JSONResult.error("出现未知错误！！，已降级！！");
            }
        };
    }
}
